home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / othergnu / trmcap10.zoo / configur.ori < prev    next >
Text File  |  1992-04-13  |  6KB  |  184 lines

  1. :
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically by autoconf.
  4. # Copyright (C) 1991 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [TARGET]
  21. # All args except --srcdir=DIR are ignored.
  22.  
  23. trap 'rm -f conftest conftest.c; exit 1' 1 3 15
  24.  
  25. set +u # Make sure unset variables are ok.
  26.  
  27. for arg in $*; do
  28.   # Handle --srcdir with a space before the argument.
  29.   if test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   else
  33.     case $arg in
  34.      +srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  35.     srcdir=`echo $arg | sed 's/[+-]*s[a-z]*=//'` ;;
  36.      +srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  37.     next_srcdir=yes ;;
  38.      +host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  39.      +host | --host | --hos | --ho | --h)
  40.     next_host=yes ;;
  41.      +gas | --gas | --ga | --g) ;;
  42.      +nfp | --nfp | --nf | --n) ;;
  43.      *) ;;
  44.     esac
  45.   fi
  46. done
  47.  
  48. INCLUDEDIR=${INCLUDEDIR-/usr/include}
  49.  
  50. rm -f conftest conftest.c
  51. compile='$CC $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  52.  
  53. # A filename unique to this package, relative to the directory that
  54. # configure is in, which we can look for to find out if srcdir is correct.
  55. unique_file=termcap.h
  56.  
  57. # Makefile rules whose targets are searched for in VPATH need to use $<.
  58. # However, old makes do not support it, so we use a combination
  59. # construction in Makefile.in: `$file<'.
  60. # If srcdir is `.', we use sed to change that to `file' for old makes.
  61. # Otherwise, we use sed to change it to `$<'.
  62. # vpsub is the sed program, which changes `$file<' to one or the other.
  63. vpsub='s,\$\([-./a-zA-Z0-9_]*\)<,\1,g'
  64. # srsub changes `@srcdir@' in Makefile.in into either `.' or the path
  65. # of the top of the source tree for the package.
  66. srsub='s,@srcdir@[-./a-zA_Z0-9_]*,.,'
  67.  
  68. # Find the source files, if location was not specified.
  69. if test x$srcdir = x; then
  70.   srcdirdefaulted=yes; srcdir=.
  71.   if test ! -r $unique_file; then srcdir=..; fi
  72. fi
  73. if test ! -r $srcdir/$unique_file; then
  74.   if test x$srcdirdefaulted = xyes; then
  75.     echo "configure: Can not find sources in \`.' or \`..'." 1>&2
  76.   else
  77.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  78.   fi
  79.   exit 1
  80. fi
  81. if test $srcdir != .; then
  82.   VPATH='VPATH = $(srcdir)'
  83.   case $srcdir in
  84.     /*|~*) ;;
  85.     *) srcdir=`pwd`/$srcdir ;; # Make relative path absolute.
  86.   esac
  87.   vpsub='s,\$\([-./a-zA-Z0-9_]*\)<,\$<,g'
  88.   srsub="s,@srcdir@,$srcdir,"
  89. fi
  90.  
  91.  
  92. # The Bourne shell writes "command not found" to /dev/tty, so if we get
  93. # a usage message on stderr, we have the program.
  94. #
  95. # ksh and zsh write "command not found" to stderr, but test -n does not
  96. # want any output if there is no program.  So we use the `type' builtin
  97. # instead for them (and bash).
  98. if test "$RANDOM" = "$RANDOM"; then
  99.   checkfor='test -n "`$checkprog $checkargs 2>&1`"'
  100. else
  101.   checkfor='type $checkprog >/dev/null'
  102. fi
  103.  
  104. echo checking for gcc
  105. checkprog=gcc checkargs=''
  106. test -z "$CC" && eval $checkfor && CC='gcc -O'
  107. CC=${CC-cc}
  108.  
  109. echo checking for install
  110. # Make sure to not get the incompatible SysV /etc/install.
  111. if test -z "$INSTALL" || test -z "$INSTALLDATA"; then
  112.   saveifs="$IFS"; IFS="$IFS:"
  113.   for dir in $PATH; do
  114.     test -z "$dir" && dir=.
  115.     if test $dir != /etc && test -f $dir/install; then
  116.       test -z "$INSTALL" && INSTALL="$dir/install -c"
  117.       test -z "$INSTALLDATA" && INSTALLDATA="$dir/install -c -m 644"
  118.       break
  119.     fi
  120.   done
  121.   IFS="$saveifs"
  122. fi
  123. INSTALL=${INSTALL-cp}
  124. INSTALLDATA=${INSTALLDATA-cp}
  125.  
  126. echo checking for BSD string and memory functions
  127. echo "#include <strings.h>
  128. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  129. eval $compile
  130. if test -s conftest && ./conftest 2>/dev/null; then :
  131. else
  132.   DEFS="$DEFS -DUSG"
  133. fi
  134. rm -f conftest conftest.c
  135.  
  136. echo checking whether the address of an argument can be used as an array
  137. echo 'main() {
  138. /* Return 0 iff arg arrays are ok.  */
  139. exit(!x(1, 2, 3, 4));
  140. }
  141. x(a, b, c, d) {
  142.   return y(a, &b);
  143. }
  144. /* Return 1 iff arg arrays are ok.  */
  145. y(a, b) int *b; {
  146.   return a == 1 && b[0] == 2 && b[1] == 3 && b[2] == 4;
  147. }' > conftest.c
  148. eval $compile
  149. ./conftest || DEFS="$DEFS -DNO_ARG_ARRAY"
  150. rm -f conftest conftest.c uttest core
  151.  
  152. trap 'for dir in .; do rm -f $dir/Makefile; done; rm -f config.status; exit 1' 1 3 15
  153.  
  154. for dir in .; do
  155.   test -d $dir || mkdir $dir
  156.   echo creating $dir/Makefile
  157.   echo '# Generated automatically from Makefile.in by configure.' > $dir/Makefile
  158.   sed -e "
  159. $vpsub
  160. $srsub
  161. s,@VPATH@,$VPATH,
  162. s,@DEFS@,$DEFS,
  163. s,@LIBS@,$LIBS,
  164. s,@PROGS@,$PROGS,
  165. s,@CC@,$CC,
  166. s,@INSTALL@,$INSTALL,
  167. s,@INSTALLDATA@,$INSTALLDATA,
  168. " $srcdir/$dir/Makefile.in >> $dir/Makefile
  169. # Prevent GNU make 3 from overflowing arg limit on SysV.
  170. echo "
  171. .NOEXPORT:" >> $dir/Makefile
  172. done
  173.  
  174. echo creating config.status
  175. echo "\
  176. DEFS=\"$DEFS\"
  177. LIBS=\"$LIBS\"
  178. PROGS=\"$PROGS\"
  179. CC=\"$CC\"
  180. INSTALL=\"$INSTALL\"
  181. INSTALLDATA=\"$INSTALLDATA\"
  182. " > config.status
  183.  
  184.